<?php
namespace Admin\Model;
use Think\Model\RelationModel;
	class ArticleModel extends RelationModel{ 
		
		protected $_auto=array(
			array('created_at','time',1,'function'),
			array('status','0'),
			array('hits','0'),
			array('content','html_special_chars_decode',3,'callback'),
		);

		protected $_link=array(
		
			'Category'=> array(  
     			'mapping_type'=>self::BELONGS_TO,
          		'class_name'=>'Category',
          		'foreign_key'=>'category_id',
				'mapping_name'=>'categoryid',
				'mapping_fields'=>'name',
				'as_fields'=>'name:catename',
			),
			
		);
		
		
	protected function html_special_chars_decode(){
			 //cont = str_replace(';nbsp',replace,$_POST['content']);
	        return htmlspecialchars_decode($_POST['content']);
	    }
	}
	
?>
